<%@page import="com.libweb.model.dto.Member"%>
<%@page import="com.libweb.model.dao.BoardDao"%>
<%@page import="com.libweb.model.dto.Board"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    
<!DOCTYPE html>

<html>
<head>
	<meta charset="EUC-KR" />
	<title>글쓰기</title>
	<link rel="Stylesheet" href="/libweb/styles/default.css" />
	<link rel="Stylesheet" href="/libweb/styles/input2.css" />	
</head>
<body>

	<div id="pageContainer">
		<%
		Board board = (Board)request.getAttribute("board");
		String pageNo = "1";
		if (request.getParameter("pageno") != null)
			pageNo = request.getParameter("pageno");
		%>
	
		<% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
		
		<div style="padding-top:25px;text-align:center">
		<div id="inputcontent">
		    <div id="inputmain">
		        <div class="inputsubtitle">댓글 쓰기</div>
		        <form action="reply.action" method="post">
		        <input type="hidden" name="pageno" 
		        	value="<%= pageNo %>" />
		        <%-- 답글을 작성할 대상글의 글번호를 저장 / submit 할 때 서버로 전송 --%>
		        <input type="hidden" name="boardno" 
		        	value="<%= board.getBoardNo() %>" />
		        <table>
		            <tr>
		                <th>제목</th>
		                <td>
		                    <input type="text" name="title" style="width:550px"
		                    	value="[RE] <%= board.getTitle() %>" />
		                </td>
		            </tr>
		            <tr>
		                <th>작성자</th>
		                <td>
							<% Member member = (Member) session.getAttribute("loginuser"); %>
		                	<input type="hidden" name="writer"
		                		value='<%= member.getMemberId() %>' />
		                	<%= member.getMemberId() %>
		                </td>
		            </tr>
		            <tr>
		                <th>내용</th>
		                <td>
							<textarea name="content" cols="76" rows="15"></textarea>
		                </td>
		            </tr>
		        </table>
		        <div class="buttons">		        	
		        	<a href="javascript:document.forms[0].submit();">저장</a>
		        	&nbsp;&nbsp;
		        	<a href="javascript:history.back();">취소</a>
		        	&nbsp;&nbsp;
		        	<a href="/libweb/board/list.action?pageno=<%= pageNo %>">목록보기</a>
		        </div>
		        </form>
		    </div>
		</div>   	
	
	</div>
	</div>

</body>
</html>